package com.yao.system.entity;


import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.List;


@Data
public class PageResult<T> {
    private Integer total;
    private Integer pages;
    private List<T> record;

    public static <T> PageResult of(Integer total, Integer pages, List<T> record) {
        PageResult<T> pageResult = new PageResult<>();
        pageResult.setPages(pages);
        pageResult.setTotal(total);
        pageResult.setRecord(record);
        return pageResult;
    }
}
